#include <iostream>
using namespace std;
class person
{
public:
    virtual void show(){
        cout<<"基类虚函数"<<endl;
    }
};
class std_1 : public person{
public:
    void show(){
        cout<<"派生类的show()函数"<<endl;
    }
    void show_std(){
        cout<<"派生类的show_std()函数"<<endl;
    }
};
int main()
{
    person* p=NULL;
    p=new std_1;
    //通过基类指针访问派生类的show_std()函数--程序报错
    //p->show_std();
    std_1* ptr = dynamic_cast<std_1*>(p);//通过关键字将基类指针p转换成派生类指针std*
    ptr->show_std();
    return 0;
}